<?php
namespace Amis\dataviewer;

use Amis\Basics\AmisBasics;

class Tag extends AmisBasics
{
    public string $type = 'tag';

    /**
     * 'normal' | 'rounded' | 'status'
     * @param string $displayMode
     * @return $this
     */
    public function displayMode(string $displayMode = 'normal')
    {
        $this->displayMode = $displayMode;
        return $this;
    }

    /**
     * 颜色主题，提供默认主题，并支持自定义颜色值
     * 'active' | 'inactive' | 'error' | 'success' | 'processing' | 'warning' | 具体色值
     * @param string $color
     * @return $this
     */
    public function color(string $color = 'active')
    {
        $this->color = $color;
        return $this;
    }

    /**
     * status 模式下的前置图标
     * @param string $icon
     * @return $this
     */
    public function icon(string $icon)
    {
        $this->icon = $icon;
        return $this;
    }
}